﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="description" content="" />
      
    <!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<![endif]-->
    <title>无人岛</title>
    <!-- BOOTSTRAP CORE STYLE -->
    <link href="assets/css/bootstrap.css" rel="stylesheet" />
    <!-- FONT AWESOME ICON STYLE -->
    <link href="assets/css/font-awesome.css" rel="stylesheet" />
    <!-- CUSTOM STYLE CSS -->
    <link href="assets/css/style.css" rel="stylesheet" />
    
 <!-- 评论框样式 -->   
<link rel="stylesheet" href="assets/css/semantic.css" type="text/css" />
<link rel="stylesheet" href="assets/css/zyComment.css" type="text/css" />
<style type="text/css" media="print, screen">  
	label {
	    font-weight: bold;
	}
	a {
		font-family: Microsoft YaHei;
	}
</style> 	
 <!-- 评论框样式 end-->   
</head>


<body>
    <div id="header">
        <div class="overlay">
            <div class="container">
                <div class="row">
                    <div class="col-md-4 logo-div">
                        <div class="logo-inner text-center">
                            <div class="logo-name">
                                <a href="index.html">
                                    <img src="assets/img/me.jpg" class="img-circle" />
                                </a>
                            </div>

                        </div>

                    </div>
                    <div class="col-md-8 header-text-top " id="about">


<!-- 标题 -->
 <div  id="container"></div>
                </div>
            </div>
        </div>
    </div>
    <!--END HEADER SECTION-->
    <div class="info-sec">
        <div class="container">
            <div class="col-md-10">
            <!--导航条-->
            <nav  class="navbar navbar-default" role="navigation">
				<div class="container-fluid">

				<div>
					<ul class="nav navbar-nav">
						<li class="active"><a href="/index.html">首页</a></li>
						<li><a href="#">归档</a></li>
						<li class="dropdown">
							<a href="#" class="dropdown-toggle" data-toggle="dropdown">
								分类
								<b class="caret"></b>
							</a>
							<ul class="dropdown-menu">
								<li><a href="#">分类1</a></li>
								<li><a href="#">分类2</a></li>
								<li><a href="#">分类3</a></li>
								<li class="divider"></li>
								<li><a href="#">分类4</a></li>
								<li class="divider"></li>
								<li><a href="#">分类5</a></li>
							</ul>
						</li>
					</ul>
				</div>
				</div>
			</nav>
			</div>
			
                <div class="col-md-2">
                    <div class="social-link">
                    
                         <button type="button" class="btn btn-primary " style="text-shadow: black 5px 3px 3px;"><span class="glyphicon glyphicon-leaf"></span> 注册</button>
                        <button onclick="window.open('/admin','_blank');" type="button" class="btn btn-primary " style="text-shadow: black 5px 3px 3px;"><span class="glyphicon glyphicon-user"></span> 登陆</button>
                    </div>

                </div>

            </div>
        </div>
    </div>
    <div class="copyrights">由 Jhon Deo 设计</div>
    
    
    <div class="container">

        <div class="row">
			
			<!--左空白-->
			

			<div class="col-md-10" >
			<br><div id="searchtitle"><h3>包含""的搜索结果:</h3></div>
			<div id="searchArea">
 			<div class="blog-post"><h2>是</h2><h4>由 <a href="#">admin</a> 发布于 2017/5/14 下午11:13:18 </h4><p>都是</p><a href="/read.html?id=62" class="btn btn-default btn-lg ">文章详情 <i class="fa fa-angle-right"></i></a> </div>
 			</div>
            
           
         	</div>
			<!--右空白-->
            <div class="col-md-2 "></div>
      </div>

 
    <!--底部代码-->
    <br><br>
<footer class="bottom">
  <div class="container" style="text-align:right">
     &copy; 2017 无人岛 |  designed by Jhon Deo
 </div>
</footer>
    <!-- END FOOTER SECTION -->
    




</body>

<!-- JAVASCRIPT FILES PLACED AT THE BOTTOM TO REDUCE THE LOADING TIME -->
    <!-- CORE JQUERY -->
    <script src="assets/js/jquery-1.11.1.js"></script>
    <!-- BOOTSTRAP SCRIPTS -->
    <script src="assets/js/bootstrap.js"></script>
<!-- 加载文章内容  请求接口 /article/getarticle -->
 <script type="text/javascript">
    $.getUrlParam = function (name) {
       var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
       var r = window.location.search.substr(1).match(reg);
       if (r != null) return unescape(r[2]); return null;
    }


    $.getUrlParam2 = function (num) {
var urlinfo = window.location.href;//获取url 
var result = urlinfo.split("?")[num].split("=")[num];//拆分url得到”=”后面的参数
return result; 
    }         
     $(function () {  
  		 $("#searchtitle").html("<h3>包含\""+decodeURI($.getUrlParam2(1))+"\"的搜索结果:</h3>");
  		  //得到文章id
          //alert($.getUrlParam('id'));
         $.ajax({  
             url: '/article/getArticleByCategory',  
             type: 'POST',  
             dataType: 'json', 
			 data:'category='+decodeURI($.getUrlParam2(1)), 
			 //contentType: "application/x-www-form-urlencoded; charset=utf-8", 
             timeout: 1000,  
             cache: false,  
             beforeSend: LoadFunction, //加载执行方法    
             error: erryFunction,  //错误执行方法    
             success: succFunction //成功执行方法    
         })  
         function LoadFunction() {  
             $("#list").html('加载中...');  
         }  
         function erryFunction() {  
             $("#list").html('加载失败...');  
         }  
         function succFunction(data) {  
             $("#searchArea").html('');  
  
             var json = eval(data); //数组         
                 $.each(json, function (index, item) {  
                 //循环获取数据  
                 var id = item.id;
                 var title = item.title;  
                 var content = item.content;
                  var publishTime = item.publishTime;
                 var password = item.password;  
                 //alert(title+content+publishTime+password);
                 var newDate = new Date();
				 newDate.setTime(publishTime * 1000); 
                 $("#searchArea").append("<div class='blog-post'><h2>"+title+"</h2><h4>由 <a href='#'>admin</a> 发布于 "+newDate.toLocaleString()+" </h4><p>"+content+"</p><a href=\'/read.html?id="+id+"\' class='btn btn-default btn-lg '>文章详情 <i class='fa fa-angle-right'></i></a></div>");  
                 });  
      
     }

		
     }); 
     
      
    </script> 
</html>